<?php

namespace App\Http\Controllers;

use App\Library\Requests\Base\SerialNumberRequest;
use App\Library\Requests\Handbook\HandbookAddRequest;
use App\Library\Requests\Handbook\HandbookEditRequest;
use App\Library\Requests\Handbook\HandbookPageRequest;
use App\Library\Service\HandbookService;
use Illuminate\Http\JsonResponse;

class HandbookController extends BaseController
{
    /**
     * @param HandbookService $service
     */
    public function __construct(HandbookService $service)
    {
        $this->service = $service;
    }

    /**
     * paging
     * @param HandbookPageRequest $request
     * @return JsonResponse
     */
    public function paging(HandbookPageRequest $request): JsonResponse
    {
        return $this->service->paging($request);
    }

    /**
     * add
     * @param HandbookAddRequest $request
     * @return JsonResponse
     */
    public function add(HandbookAddRequest $request): JsonResponse
    {
        return $this->service->add($request);
    }

    /**
     * edit
     * @param HandbookEditRequest $request
     * @return JsonResponse
     */
    public function edit(HandbookEditRequest $request): JsonResponse
    {
        return $this->service->edit($request);
    }

    /**
     * detail
     * @param SerialNumberRequest $request
     * @return JsonResponse
     */
    public function detail(SerialNumberRequest $request): JsonResponse
    {
        return $this->service->detail($request);
    }

    /**
     * delete
     * @param SerialNumberRequest $request
     * @return JsonResponse
     */
    public function delete(SerialNumberRequest $request): JsonResponse
    {
        return $this->service->delete($request);
    }
}
